docs: document mark and scope event sanitizers [6/6]#376
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
d72e192 to
97d8c7b
Compare
WalkthroughThis documentation update introduces the mark and scope event sanitizer contract, registration and ordering rules, binding guidance, PII redaction configuration, and lifecycle semantics for sanitized events and pending marks. ChangesEvent sanitizer contract
Middleware and plugin integration
PII redaction
Lifecycle and export semantics
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/skills/add-middleware/SKILL.md:
- Around line 49-51: The documented event-sanitizer workflow in the “Mark and
scope events” section omits exporter dispatch. Update the dispatch-stage wording
to explicitly say “subscriber and exporter dispatch,” ensuring it reflects the
destinations covered by the event-sanitizer contract.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: b908c56a-a4ea-4788-b77d-eb922007ce71
📒 Files selected for processing (15)
.agents/skills/add-middleware/SKILL.mdcrates/node/README.mddocs/about-nemo-relay/concepts/events.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/advanced-configuration.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdxdocs/instrument-applications/adding-scopes-and-marks.mdxdocs/reference/event-sanitizers.mdxdocs/reference/tool-execution-intercept-outcomes.mdxgo/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (23)
**/*.mdx
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
MDX top-of-file SPDX comments must use {/* ... */} delimiters instead of HTML comment delimiters (Must-Fix)
In MDX files, top-of-file comments must use JSX comment delimiters (
{/*to open and*/}to close); do not use HTML comments for MDX SPDX headers
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxdocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
**/*.{md,mdx}
📄 CodeRabbit inference engine (AGENTS.md)
Update
README.md,fern/, package READMEs, and binding-support notes when public behavior, package names, examples, or supported bindings change.
**/*.{md,mdx}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Keep release-process and release-notes guidance in repo-maintainer docs such asRELEASING.md, not as user-facing docs pages orCHANGELOG.md
Keep stable user-facing wrappers atscripts/root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
When detailed dynamic plugin guides exist, keep Rust native plugin examples, Python worker plugin examples, andgrpc-v1protocol details on separate pagesIf links in documentation change, run
just docs-linkcheck.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxgo/nemo_relay/README.mdpython/nemo_relay/README.mddocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.mddocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
**/*.{md,markdown,mdx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Add the SPDX license header to all Markdown/MDX documentation files using the HTML comment block form.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxgo/nemo_relay/README.mdpython/nemo_relay/README.mddocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.mddocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
{docs,examples}/**/*
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update docs and examples.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxdocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, usemaintain-dynamic-pluginsand include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, preferuv run pre-commit run --files <changed files...>.
Before review or handoff, runuv run pre-commit run --all-files.
**/*: Usekarpathy-guidelinesalongside this skill; keep changes scoped, surface assumptions, and define focused validation before editing.
Expose the new middleware surface in every affected binding, following theadd-binding-featurecross-binding checklist.
Provide parity coverage in every affected binding.
Runvalidate-changeto validate the implementation.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxgo/nemo_relay/README.mdpython/nemo_relay/README.mddocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.mddocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
docs/**/*
📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)
If documentation examples or commands under
docs/change, run the targeted docs checks appropriate to the change.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxdocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
**
⚙️ CodeRabbit configuration file
**:AGENTS.md
This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.
Project Overview
NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go and the raw C FFI are experimental and source-first.
The shared runtime model is:
- Scope stacks decide where work belongs and which scope-local behavior is visible.
- Middleware registries decide what guardrails and intercepts run around managed calls.
- Plugins install reusable runtime behavior from configuration.
- Events record runtime behavior in ATOF form.
- Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.
Repository Structure
The repository layout separates the Rust runtime, language bindings,
documentation, integrations, and agent-facing skills.crates/ core/ # Rust core runtime crate, published as nemo-relay adaptive/ # Adaptive runtime primitives and plugin components python/ # PyO3 native extension for the Python package ffi/ # Raw C ABI layer used by downstream bindings such as Go node/ # NAPI Node.js binding and JavaScript/TypeScript entry points python/ nemo_relay/ # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers tests/ # Python tests go/ nemo_relay/ # Experimental Go CGo binding and tests fern/ # Fern documentation site scripts/ # Stable wrappers and helper scripts; build/test/docs entry points live in justfile skills/ # Published Codex/agent skills for NeMo Relay usage patternsPrerequisites
Insta...
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxgo/nemo_relay/README.mdpython/nemo_relay/README.mddocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.mddocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}
⚙️ CodeRabbit configuration file
{docs/**,README.md,CONTRIBUTING.md,RELEASING.md,SECURITY.md}: Review documentation for technical accuracy against the current API, command correctness, and consistency across language bindings.
Flag stale examples, missing SPDX headers where required, and instructions that no longer match CI or pre-commit behavior.
Files:
docs/instrument-applications/adding-scopes-and-marks.mdxdocs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdxdocs/about-nemo-relay/concepts/events.mdxdocs/reference/tool-execution-intercept-outcomes.mdxdocs/about-nemo-relay/concepts/middleware.mdxdocs/reference/event-sanitizers.mdxdocs/configure-plugins/pii-redaction/about.mdxdocs/configure-plugins/pii-redaction/configuration.mdx
{crates/core/src/plugin/dynamic/**,crates/plugin/**,crates/worker/**,crates/worker-proto/**,crates/types/**,python/plugin/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)
Keep the stable boundary explicit: native plugins cross a C ABI, and worker plugins cross
grpc-v1.
Files:
docs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdx
{crates/core/src/plugin/dynamic/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**,docs/build-plugins/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)
Native and worker plugins are trusted extensions; document that native plugins are in-process and unsandboxed, and worker plugins provide process isolation but not a security sandbox.
Files:
docs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdx
{docs/build-plugins/**,examples/rust-native-plugin/**,examples/python-grpc-worker-plugin/**}
📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)
When detailed dynamic plugin guides exist, keep Rust native, Python worker, and
grpc-v1protocol details on separate pages.
Files:
docs/build-plugins/language-binding/about.mdxdocs/build-plugins/language-binding/register-behavior.mdxdocs/build-plugins/language-binding/advanced-configuration.mdx
**/*.{md,rst,html,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
**/*.{md,rst,html,txt}: Always spellNVIDIAin all caps. Do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names withNVIDIAon first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms withs, not an apostrophe, such asGPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such asCPU,GPU,PC,API, andUIusually do not need to be spelled out for developer audiences.
Files:
go/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.md
**/*.{md,rst,html}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
Link the first mention of a product name when the destination helps the reader.
Files:
go/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.md
**/*.{md,rst,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
Spell
NVIDIAin all caps. Do not useNvidia,nvidia, orNV.
Files:
go/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.md
**/*.{md,rst}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,rst}: Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as "here" or "read more."
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce.
Preferrefer tooverseewhen the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical docs.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented docs unless the source, platform, or legal guidance explicitly requires them.
Files:
go/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.md
**/*.md
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-technical-docs.md)
**/*.md: Use title case consistently in technical documentation headings
Avoid quotation marks, ampersands, and exclamation marks in headings
Keep product, event, research, and whitepaper names in their official title case
Use title case for table headers
Do not force social-media sentence case into technical docs
Format code elements, commands, parameters, package names, and expressions in monospace
Format directories, file names, and paths in monospace using backticks
Use angle brackets inside monospace for variables inside paths, such as/home/<username>/.login
Format error messages and strings in quotation marks, keeping literal code strings in code formatting when clearer
Format UI buttons, menus, fields, and labels in bold
Use angle brackets between UI labels for menu paths, such as File > Save As
Use italics for new terms on first use, sparingly and only when introducing the term
Use italics for publication titles
Format keyboard shortcuts in plain text, such as Press Ctrl+Alt+Delete
Use owner/repo link text for GitHub repositories, preferring[NVIDIA/NeMo](link)over prose references like 'the GitHub repo'
Introduce every code block with a complete sentence
Do not make a code block complete the grammar of the previous sentence
Do not continue a sentence after a code block
Use syntax highlighting when the format supports it for code blocks
Avoid the word 'snippet' unless the surrounding docs already use it as a term of art
Keep inline method, function, and class references consistent with nearby docs, omitting empty parentheses for prose readability when no call is shown
Use descriptive anchor text that matches the destination title when possible for links
Avoid raw URLs in running text
Avoid generic anchor text such as 'here,' 'this page,' and 'read more'
Include acronyms in link text when a linked term includes an acronym
Do not link long sentences or multiple sentences
Avoid links that pull readers away from a procedure unless the link is a p...
Files:
go/nemo_relay/README.mdpython/nemo_relay/README.mdskills/nemo-relay-export-atif-trajectories/SKILL.mdcrates/node/README.md
go/nemo_relay/**
📄 CodeRabbit inference engine (.agents/skills/maintain-optimizer/SKILL.md)
Keep shared plugin helpers in
go/nemo_relayaligned with plugin registration, composition, and lifecycle behavior.
Files:
go/nemo_relay/README.md
go/nemo_relay/**/*
⚙️ CodeRabbit configuration file
go/nemo_relay/**/*: Review Go binding changes for cgo memory ownership, race safety, callback cleanup, idiomatic exported APIs, and parity with Rust/FFI behavior.
Any API change should include focused Go tests and consider race-test behavior.
Files:
go/nemo_relay/README.md
python/nemo_relay/**/*
⚙️ CodeRabbit configuration file
python/nemo_relay/**/*: Review Python wrapper changes for typed API consistency, contextvars-based scope isolation, async behavior, and parity with the native extension.
Stubs and runtime implementations should stay aligned.
Files:
python/nemo_relay/README.md
**/SKILL.md
📄 CodeRabbit inference engine (AGENTS.md)
SKILL.mdfiles are skill entrypoints and must start with YAML frontmatter containing at leastnameanddescription.
Files:
skills/nemo-relay-export-atif-trajectories/SKILL.md
⚙️ CodeRabbit configuration file
**/SKILL.md: Do not flag SKILL.md files for missing SPDX headers. Skill entrypoints intentionally start with YAML frontmatter instead.
Verify that every SKILL.md keeps valid YAML frontmatter with at least name and description fields before the Markdown body.
Files:
skills/nemo-relay-export-atif-trajectories/SKILL.md
crates/{python,ffi,node}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/node/README.md
.agents/skills/**
⚙️ CodeRabbit configuration file
.agents/skills/**:Maintainer Skills
This directory is the maintainer-only skill set for developing NeMo Relay
itself.Use these skills for repository work such as:
- Changing core or binding APIs
- Maintaining integrations, packaging, CI, and docs
- Extending middleware or observability internals
- Validating library changes across bindings
Consumer-facing NeMo Relay usage skills live in the top-level
skills/
directory so they can be exported separately for integrators and end users.
Files:
.agents/skills/add-middleware/SKILL.md
.agents/skills/add-middleware/**
⚙️ CodeRabbit configuration file
.agents/skills/add-middleware/**: ---
name: add-middleware
description: Add a new guardrail or intercept type to the NeMo Relay middleware pipeline
author: NVIDIA Corporation and Affiliates
license: Apache-2.0Add a Middleware Type
Companion Guidance
Use
karpathy-guidelinesalongside this skill for implementation or review
work. Keep changes scoped, surface assumptions, and define focused validation
before editing.NeMo Relay supports guardrails (validate/gate) and intercepts (transform) at various
pipeline stages. Adding a new middleware type requires changes across all layers.Use this skill when introducing a new middleware registration surface or adding
middleware behavior to a new pipeline stage.Lock The Design First
Decide these before editing code:
- Is this for tools, LLMs, or both?
- Is it a conditional guardrail, sanitize guardrail, request intercept, or
execution intercept?- Does it run on request input, inner callable execution, stream chunks, or
final response output?- Is the callback fallible, and how should callback failures propagate?
- Does it need both global and scope-local registration?
- What should subscribers observe in
event.inputandevent.outputafter this
middleware runs?Pipeline Order
See
docs/about/concepts/middleware.mdfor the full diagrams.
- Tool execute:
conditional guardrails -> request intercepts -> sanitize request (for events)
| execution intercept chain(callable) -> sanitize response- LLM execute:
conditional guardrails -> request intercepts -> sanitize request (for events)
| execution intercept chain(callable) -> sanitize responseCore Steps
- Define or reuse the callback type alias in
crates/core/src/api/runtime/callbacks.rs.pub type MyNewFn = Box<dyn Fn(&str, Json) -> Json + Send + Sync>;
- Add the registry field to
NemoRelayContextStatein
crates/core/src/api/runtime/state.rs.Add a
SortedRegistry<GuardrailEntry<MyNewFn>>or...
Files:
.agents/skills/add-middleware/SKILL.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, decide whether the middleware targets tools, LLMs, marks, scope events, or a combination.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, classify the middleware as a conditional guardrail, sanitize guardrail, request intercept, or execution intercept.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, decide whether the middleware runs on request input, inner callable execution, stream chunks, or final response output.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, define callback failure behavior and whether callback errors propagate.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Before editing, determine whether both global and scope-local registration are required.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: Define what subscribers observe in `event.input` and `event.output` after middleware execution.
Learnt from: CR
Repo: NVIDIA/NeMo-Relay
Timestamp: 2026-07-10T23:26:37.783Z
Learning: For event sanitizers, define which of `data`, `category_profile`, and `metadata` may change and whether the event is immutable context.
🔇 Additional comments (25)
docs/about-nemo-relay/concepts/events.mdx (1)
106-110: LGTM!crates/node/README.md (1)
44-46: LGTM!go/nemo_relay/README.md (1)
42-44: LGTM!python/nemo_relay/README.md (1)
43-45: LGTM!docs/reference/event-sanitizers.mdx (1)
157-159: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winFormat protocol constants as code.
These stable registration values should use inline code formatting so readers can distinguish protocol constants from prose.
Proposed fix
-- `MARK_SANITIZE_GUARDRAIL = 30` -- `SCOPE_SANITIZE_START_GUARDRAIL = 31` -- `SCOPE_SANITIZE_END_GUARDRAIL = 32` +- `MARK_SANITIZE_GUARDRAIL` = `30` +- `SCOPE_SANITIZE_START_GUARDRAIL` = `31` +- `SCOPE_SANITIZE_END_GUARDRAIL` = `32`As per coding guidelines, format code elements, commands, parameters, package names, and expressions in monospace.
> Likely an incorrect or invalid review comment.Source: Coding guidelines
docs/about-nemo-relay/concepts/middleware.mdx (1)
11-12: LGTM!Also applies to: 110-125, 281-283
docs/build-plugins/language-binding/about.mdx (1)
67-68: LGTM!docs/build-plugins/language-binding/advanced-configuration.mdx (1)
161-162: LGTM!docs/build-plugins/language-binding/register-behavior.mdx (1)
37-44: LGTM!.agents/skills/add-middleware/SKILL.md (1)
27-27: LGTM!Also applies to: 36-37, 96-96
docs/configure-plugins/pii-redaction/about.mdx (4)
11-12: LGTM!
33-34: LGTM!
70-74: LGTM!
93-97: LGTM!docs/configure-plugins/pii-redaction/configuration.mdx (7)
69-71: LGTM!
91-91: LGTM!
136-136: LGTM!
164-169: LGTM!
180-180: LGTM!
290-293: LGTM!
344-360: LGTM!docs/reference/tool-execution-intercept-outcomes.mdx (2)
32-37: LGTM!
49-50: LGTM!docs/instrument-applications/adding-scopes-and-marks.mdx (1)
203-205: LGTM!skills/nemo-relay-export-atif-trajectories/SKILL.md (1)
53-54: LGTM!
| - **Mark and scope events**: | ||
| specialized tool/LLM sanitizer (when applicable) -> mark or scope event | ||
| sanitizer -> subscriber dispatch |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Include exporters in the documented dispatch stage.
Event sanitizers run before both subscribers and exporters, but this workflow lists only subscriber dispatch. That can cause implementers to omit exporter-path validation or misunderstand the privacy guarantee. Change this to “subscriber and exporter dispatch.” The contract in docs/reference/event-sanitizers.mdx:9-56 explicitly covers both destinations.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills/add-middleware/SKILL.md around lines 49 - 51, The documented
event-sanitizer workflow in the “Mark and scope events” section omits exporter
dispatch. Update the dispatch-stage wording to explicitly say “subscriber and
exporter dispatch,” ensuring it reflects the destinations covered by the
event-sanitizer contract.
Overview
Documents the RELAY-409 event sanitizer and PII redaction behavior in one independent, docs-only PR so the writing review is not repeated across the implementation stack.
Details
mark = truedefaults, opt-out behavior, broaderinput/outputscope coverage, and exporter privacy guarantees.mainafter PRs feat(sanitizers)!: add mark and scope event sanitizer registries [1/6] #371–feat: expose event sanitizers through C and Go [5/6] #375 merged, resolving the subsequent documentation reorganization.Validation:
just docs,just docs-linkcheck, anduv run pre-commit run --all-files.Where should the reviewer start?
Start with
docs/reference/event-sanitizers.mdx, then reviewdocs/configure-plugins/pii-redaction/configuration.mdxfor the privacy contract changes.Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
data,category_profile, andmetadatawhile preserving immutable event context.